<?php $__env->startSection('content'); ?>


	<section class="hbox stretch">
		<?php echo $__env->make("back.public.left", array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

		<aside>
			<section class="vbox">

				<header class="header bg-white b-b clearfix">
					<form class="talbe-search" method="get" action="">
						<div class="row m-t-sm">
							<div class="col-sm-12 m-b-xs">
								<div class="btn-group" role="group">
									<strong style="line-height:30px;">添加管理员</strong>
								</div>
								<div class="btn-group pull-right">
									<a role="button" class="btn btn-info btn-sm " title="返回" onclick="history.back()">
										<i class="glyphicon glyphicon-arrow-left"></i>&nbsp;返回
									</a>
								</div>
							</div>
						</div>
					</form>
				</header>
				<section class="scrollable  wrapper w-f">
					<section class="panel panel-default ">
						<div class="row m-l-none m-r-none bg-light lter">
							<div class="container" style="padding: 20px 0px">
								<form id="formclass" class="form-horizontal" style="padding-top: 15px;">
									<div class="form-group">
										<label class="col-sm-3 control-label">帐号<span class="red">*</span></label>
										<div class="col-sm-4 ">
											<input type="text" name="account" class="form-control" pattern="^\w+$" maxLength="20"
												   placeholder="请输入帐号">
										</div>
									</div>
									<input type="password" style="visibility: hidden;" >
									<div class="form-group">
                                        <label class="col-sm-3 control-label">密码<span class="red">*</span></label>
                                        <div class="col-sm-4 ">
                                            <input type="password" class="form-control" name="password" pattern="^\w+$" maxLength="12"
                                                   placeholder="请输入密码">
                                        </div>
                                    </div>
									<div class="form-group">
										<label class="col-sm-3 control-label"></label>
										<div class="col-sm-2 ">
											<button role="button" class="btn btn-default" addparm="" type="submit">提交</button>
											<input type="checkbox" id="back" name="back">
                                            <label for="back">返回列表</label>
										</div>
									</div>
								</form>
							</div>
						</div>

					</section>
				</section>


			</section>
		</aside>
	</section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('addscript'); ?>
	<script>
		$(function(){
			var checkSubmitFlg = false;
			$("#formclass").submit(function(){
				if(checkSubmitFlg ==true){
					return false;
				}
				checkSubmitFlg = true;
				var account=$("[name=account]").val();
				var password=$("[name=password]").val();
				var role_id=$("[name=role_id]").val();
				var back=$("[name=back]").is(':checked');
				if(account==""){
					layer.alert("帐户不得为空！");
					return false;
				}
				if(password==""){
					layer.alert("密码不得为空！");
					return false;
				}
				$.ajax({
					url:"<?php echo e(url('back/user/create')); ?>",
					type:"post",
					dataType:"json",
					data:{
						account:account,
						password:password,
						role_id:role_id,
						status:status
					},
					success:function(data){
						if(data.success){
							layer.alert(data.msg,function(){
							    if (back) {
							        location.href="<?php echo e(url('back/user')); ?>";
							    } else {
							        location.reload();
							    }
							});
						}
						else{
							layer.alert(data.msg);
						}
					}
				})
				return false;
			})


		});
	</script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('back.adminbase', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>